package com.cartoon.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.cartoon.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import model.CartoonLRYSearchModel;
import pic.PicLoadManager;

public  class LRYSearchAnimeAdapter extends BaseQuickAdapter<CartoonLRYSearchModel.DataBean, BaseViewHolder> {
    public LRYSearchAnimeAdapter(int layoutResId, @Nullable @org.jetbrains.annotations.Nullable List<CartoonLRYSearchModel.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CartoonLRYSearchModel.DataBean item) {
        ImageView pic = helper.itemView.findViewById(R.id.iv_pig);
        TextView tv_name = helper.itemView.findViewById(R.id.tv_name);
        TextView tv_time = helper.itemView.findViewById(R.id.tv_time);
        TextView tv_descs = helper.itemView.findViewById(R.id.tv_descs);
        PicLoadManager.loadPicture(item.getCover(),pic);
        helper.setText(R.id.tv_name,item.getTitle());

        helper.setText(R.id.tv_descs,item.getDescs().toString());

        tv_descs.setSelected(true);
        tv_name.setSelected(true);
        tv_time.setSelected(true);
    }
}
